<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>失物招领</title>
    <link href="{{ asset('/static/vendor/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ asset('/static/vendor/bootstrap-select/css/bootstrap-select.min.css') }}" rel="stylesheet">
    <link href="{{ asset('/static/vendor/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css') }}"
          rel="stylesheet">
    <link href="{{ asset('/static/vendor/bootstrap-fileinput/css/fileinput.min.css') }}" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{{ url('/') }}">400-12345678</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                @if (Auth::guest())
                    <li><a href="{{ url('/account/login') }}">登陆</a></li>
                    <li><a href="{{ url('/account/register') }}">注册</a></li>
                @else
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                           aria-expanded="false">{{ Auth::user()->name }} <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="{{url('/user')}}">用户中心</a></li>
                            <li class="divider"></li>
                            @if(Auth::user()->isAdmin())
                                <li><a href="{{url('/admin')}}">后台管理</a></li>
                                <li class="divider"></li>
                            @endif
                            <li><a href="{{ url('/account/logout') }}">退出</a></li>
                        </ul>
                    </li>
                @endif
            </ul>
        </div>
    </div>
</nav>
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="{{ asset('/static/js/jquery-1.11.3.min.js') }}"></script>
<script src="{{ asset('/static/vendor/bootstrap/js/bootstrap.min.js') }}"></script>
<script src="{{ asset('/static/vendor/bootstrap-select/js/bootstrap-select.min.js') }}"></script>
<script src="{{ asset('/static/vendor/bootstrap-select/js/i18n/defaults-zh_CN.min.js') }}"></script>
<script src="{{ asset('/static/vendor/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js') }}"></script>
<script src="{{ asset('/static/vendor/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js') }}"></script>
<script src="{{ asset('/static/vendor/bootstrap-fileinput/js/fileinput.min.js') }}"></script>
<script src="{{ asset('/static/vendor/bootstrap-fileinput/js/fileinput_locale_zh.js') }}"></script>

<script src="{{ asset('/static/js/index/app.js') }}"></script>
<div class="container" style="margin-bottom:40px">
    <div class="col-sm-12">
        <form role="search" action="{{url('/item')}}">
            <div class="col-lg-2">
                <img src="{{asset('static/images/logo.png')}}" style="width:166px;height:66px;"/>
            </div>
            <div class="col-lg-7" style="margin:15px 0">
                <input type="text" class="form-control" aria-label="...">
            </div>
            <div class="col-lg-3" style="margin:15px 0">
                <button type="submit" class="btn btn-success">试试手气</button>
            </div>
        </form>
    </div>
</div>
<div class="container-fluid" style="margin:20px 0;padding:0;">
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
        </ol>
        <div class="carousel-inner" role="listbox" style="height:400px;">
            <div class="item active">
                <img src="{{asset('static/images/1.jpg')}}" style="width:100%;">
            </div>
            <div class="item">
                <img src="{{asset('static/images/2.jpg')}}" style="width:100%;">
            </div>
        </div>
        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>
</div>
<div class="container">
    <div class="col-sm-6">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">捡到东西，要还</h3>
            </div>
            <div class="panel-body">
                <form class="form-horizontal" action="{{url('/user/add-item?type=find')}}">
                    <input type="hidden" name="type" value="find">

                    <div class="form-group">
                        <label class="col-sm-2 control-label">地点</label>

                        <div class="col-sm-3">
                            <select name="province_id" class="selectpicker" data-width="100" data-toggle="selectpicker"
                                    data-nextselect="#lost_city_id" data-refurl="{{url('api/area/areas?id=')}}{value}"
                                    data-type="get">
                                @foreach($provinces as $province)
                                    <option value="{{$province->id}}">{{$province->name}}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="col-sm-3">
                            <select name="city_id" id="lost_city_id" class="selectpicker" data-width="100"
                                    data-toggle="selectpicker"
                                    data-nextselect="#lost_district_id"
                                    data-refurl="{{url('api/area/areas?id=')}}{value}"
                                    data-type="get">
                                <option></option>
                                @foreach($cities as $city)
                                    <option value="{{$city->id}}">{{$city->name}}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="col-sm-3">
                            <select name="district_id" id="lost_district_id" class="selectpicker" data-width="100">
                                <option></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">分类</label>

                        <div class="col-sm-3">
                            <select name="p_catalog_id" class="selectpicker" data-width="100" data-toggle="selectpicker"
                                    data-nextselect="#lost_catalog_id"
                                    data-refurl="{{url('api/catalog/catalogs?id=')}}{value}"
                                    data-type="get">
                                <option></option>
                                @foreach($p_catalogs as $catalog)
                                    <option value="{{$catalog->id}}">{{$catalog->name}}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="col-sm-3">
                            <select name="catalog_id" id="lost_catalog_id" class="selectpicker" data-width="100">
                                <option></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-10 col-sm-offset-2">
                            <button class="btn btn-primary">还东西</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="col-sm-6">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">丢了东西，要找</h3>
            </div>
            <div class="panel-body">
                <form class="form-horizontal" action="{{url('/user/add-item?type=lost')}}">
                    <input type="hidden" name="type" value="lost">

                    <div class="form-group">
                        <label class="col-sm-2 control-label">地点</label>

                        <div class="col-sm-3">
                            <select name="province_id" class="selectpicker" data-width="100" data-toggle="selectpicker"
                                    data-nextselect="#find_city_id" data-refurl="{{url('api/area/areas?id=')}}{value}"
                                    data-type="get">
                                @foreach($provinces as $province)
                                    <option value="{{$province->id}}">{{$province->name}}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="col-sm-3">
                            <select name="city_id" id="find_city_id" class="selectpicker" data-width="100"
                                    data-toggle="selectpicker"
                                    data-nextselect="#find_district_id"
                                    data-refurl="{{url('api/area/areas?id=')}}{value}"
                                    data-type="get">
                                <option></option>
                                @foreach($cities as $city)
                                    <option value="{{$city->id}}">{{$city->name}}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="col-sm-3">
                            <select name="district_id" id="find_district_id" class="selectpicker" data-width="100">
                                <option></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">分类</label>

                        <div class="col-sm-3">
                            <select name="p_catalog_id" class="selectpicker" data-width="100" data-toggle="selectpicker"
                                    data-nextselect="#find_catalog_id"
                                    data-refurl="{{url('api/catalog/catalogs?id=')}}{value}"
                                    data-type="get">
                                <option></option>
                                @foreach($p_catalogs as $catalog)
                                    <option value="{{$catalog->id}}">{{$catalog->name}}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="col-sm-3">
                            <select name="catalog_id" id="find_catalog_id" class="selectpicker" data-width="100">
                                <option></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-10 col-sm-offset-2">
                            <button class="btn btn-primary">找东西</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="col-sm-6">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">最新找到</a></li>
            <li class="pull-right"><a href="{{url('/item?type=find')}}">更多>></a></li>
        </ul>
        <div class="view">
            <ul class="list-group">
                @foreach($findItems as $item)
                    <a class="list-group-item" href="{{url('/item/' . $item->id)}}">
                        <span class="badge">{{$item->findLostTime()}}</span>
                        <h4 class="list-group-item-heading">{{$item->name}}</h4>

                        <p class="list-group-item-text">{{$item->address()}}</p>
                    </a>
                @endforeach
            </ul>
        </div>
    </div>
    <div class="col-sm-6">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">最新发布</a></li>
            <li class="pull-right"><a href="{{url('/item?type=lost')}}">更多>></a></li>
        </ul>
        <div class="view">
            <ul class="list-group">
                @foreach($lostItems as $item)
                    <a class="list-group-item" href="{{url('/item/' . $item->id)}}">
                        <span class="badge">{{$item->findLostTime()}}</span>
                        <h4 class="list-group-item-heading">{{$item->name}}</h4>

                        <p class="list-group-item-text">{{$item->address()}}</p>
                    </a>
                @endforeach
            </ul>
        </div>
    </div>
    <div class="col-sm-12">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">寻人启事</a></li>
            <li class="pull-right"><a href="{{url('/item?type=lost&p_catalog_id=3')}}">更多>></a></li>
        </ul>
        <div class="view">
            <ul class="list-group">
                @foreach($lostPeoples as $item)
                    <a class="list-group-item" href="{{url('/item/' . $item->id)}}" style="">
                        <img src="{{$item->img_url}}" width="100px" height="100px">
                        <span class="badge">{{$item->findLostTime()}}</span>
                        <span><h4 class="list-group-item-heading">{{$item->name}}</h4>

                        <p class="list-group-item-text">{{$item->address()}}</p></span>
                    </a>
                @endforeach
            </ul>
        </div>
    </div>
</div>
<hr>
<footer style="margin:15px 0;">
    <div class="container">
        <div class="col-lg-2">
            <img src="{{asset('static/images/logo.png')}}" style="width:166px;height:66px;"/>
        </div>
        <div style="margin-top:25px;">
            <div class="col-sm-1"><a href="{{url('about')}}"><h5>关于我们</h5></a></div>
            <div class="col-sm-1"><a href="{{url('about/advert')}}"><h5>广告合作</h5></a></div>
            <div class="col-sm-1"><a href="{{url('about/links')}}"><h5>友情链接</h5></a></div>
        </div>
    </div>
</footer>
</body>
</html>